﻿using System;
/*
    Write an expression that checks if given positive integer number n (n = 100) is prime 
    (i.e. it is divisible without remainder only to itself and 1).
 */

class PrimeNumberCheck
{
    static void Main()
    {
        Console.WriteLine("Enter a number");
        int number = Convert.ToInt32(Console.ReadLine());
        int result = CheckPrime(number);
        if (result == 0)
        {
            Console.WriteLine("{0} is not a prime number", number);
        }
        else
        {
            Console.WriteLine("{0} is  a prime number", number);
        }
        
    }
    private static int CheckPrime(int number)
    {
        int i;
        for (i = 2; i <= number - 1; i++)
        {
            if (number % i == 0)
            {
                return 0;
            }
        }
        if (i == number)
        {
            return 1;
        }
        return 0;
    }
}
